// 用于合并resolve url，
// 如base = http://localhost:8080/aaa/bbb，url = /ccc/ddd.html，
// 结果为：http://localhost:8080/ccc/ddd/html
export default function(url, base) {
  if (/^http/.test(url)) {
    this.href = url;
  } else {
    const position = base.indexOf('/', base.indexOf(':') + 3);
    this.href = base.substr(0, position == -1 ? undefined : position) + url;
  }
}
